widget: reset all controllers when the widget becomes insensitive
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 5 Jun 2014 13:31:35 +0000 (15:31 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 5 Jun 2014 14:15:54 +0000 (16:15 +0200)
Widgets becoming insensitive won't receive further events, but there
could be chances the controllers don't get properly notified and reset
in those situations.

gtk/gtkwidget.c

index 39c0338d393f44db131684aba4dbbebc79d748ea..27e28962d5c2d1f434564970c44f1cfa19e62256 100644 (file)
@@ -12681,6 +12681,19 @@ gtk_widget_propagate_state (GtkWidget    *widget,
           g_list_free (devices);
         }
 
+      if (!gtk_widget_is_sensitive (widget))
+        {
+          EventControllerData *data;
+          GList *l;
+
+          /* Reset all controllers */
+          for (l = priv->event_controllers; l; l = l->next)
+            {
+              data = l->data;
+              gtk_event_controller_reset (data->controller);
+            }
+        }
+
       if (GTK_IS_CONTAINER (widget))
         {
           GtkStateData child_data;